package top.chmin.project.cloud.common;

import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * chmin
 * 2023/12/15 9:10
 * cloud-builder
 */

@Getter
@Setter
@Accessors(chain = true)
public class Page<T> {

    private boolean desc;
    private int page;
    private int pageSize;
    private int total;
    private List<T> list;

    public Page(int page, int pageSize) {
        this.page = page;
        this.pageSize = pageSize;
        this.desc = true;
    }

    public Page(Page<?> page) {
        this.page = page.getPage();
        this.pageSize = page.getPageSize();
        this.desc = page.desc;
    }

    public Page() {
        this(1, 10);
    }

}
